package cn.tedu.binary;

public class Demo04 {
    public static void main(String[] args) {
        int n = -50;
        System.out.println(n);
        System.out.println(Integer.toBinaryString(n));
        System.out.println(n>>1);
        System.out.println(Integer.toBinaryString(n>>1));
        System.out.println(n>>2);
        System.out.println(Integer.toBinaryString(n>>2));

        //除了最小值，其他数字都满足 -n = ~n + 1
        System.out.println(56); //56
        System.out.println(~56+1); //-56

        System.out.println(-67); //-67
        System.out.println(~-67+1);//67

        //最小值除外！
        int min = Integer.MIN_VALUE;
        System.out.println(min);
        System.out.println(~min+1);
        System.out.println(-min);

        System.out.println(Integer.toString(50));


    }
}
